import { XmImage } from "@/components/tool";
import { View, Text } from "@tarojs/components";
import { observer } from "mobx-react";
import React, { Fragment } from "react";
import Button from "@taroify/core/button/button";
import Navbar from "@/components/tool/navbar";
import { BaseRouter } from "@/path/router";
import "./index.scss"
function Index() {
  const params:any = BaseRouter.getData()
  return <>
    <View className="reg-status-nav">
      <Navbar showIcon={true} titleClassName="reg-status-nav-title" title={params.title} />
    </View>
    <View className="reg-status-center">
      <XmImage className="reg-status-img" src={params.img} static></XmImage>
    </View>
    <View className="reg-status-text">
      <Text>{params.text}</Text>
    </View>
    <View className="reg-status-back">
      <Button color="primary" onClick={()=>{
        try {
          console.log(1,params.url)
          if(params.url!=''&& params.url!= undefined){
            console.log(2)
            BaseRouter.reLaunch<null>({ url: params.url })
          }else{
            BaseRouter.back()
          }
        } catch (error) {
          console.log(3)
          
        }
      }} shape="round" block>返回</Button>
    </View>
  </>
}

const Higher = React.memo(observer(Index));
export default () => <Fragment><Higher /></Fragment>
